Generally connected to the database, you must install the client, I generally do not write blog writing principles, but later found to look back to their own writing I do not understand, so this chapter blog will be a bit more original rational
Install FreeTDS
FreeTDS is the Linux/unix next set of software development kits for implementing Microsoft SQL Server and Sybase's tabular DataStream Protocol protocol. With FreeTDS, you can connect SQL Server and Sybase databases under Linux/unix.
If you need to use PHP to connect to a Microsoft SQL Server 2005 database on a Linux system, our common way to connect to a database is to use ODBC to connect.
FreeTDS provides an open source client for the TDS protocol for Linux systems.
In order to enable PHP to connect MSSQL, the system needs to install mssql,php, and in the php.ini configuration, will
Extension=php_mssql.dll in front of;
1. Connect MSSQL
Copy CodeThe code is as follows:
$conn =mssql_connect ("Instance name or
When you operate MSSQL in PHP, you must first determine whether the system running environment is supported. run the following statement to know [php] if (function_exists (& amp; #39; mssql_connect & amp; #39;) {echo & amp; #39; this function exists,
In order to enable PHP connection MSSQL, the system needs to install mssql,php, and in the configuration of php.ini, Extension=php_mssql.dll Front; remove 1. Connect MSSQL $conn =mssql_connect (" Instance name or server IP "," User name "," password
If you need to use PHP to connect to a Microsoft SQL Server 2005 database on a Linux system, our common way to connect to a database is to use ODBC to connect.
FreeTDS provides an open source client for the TDS protocol for Linux systems. Because
If PHP and MySQL connections are implemented, the links between PHP and MSSQL are actually very simple. local and remote connections of MSSQL are supported.
The code is as follows:
$ ServerSite = ".";$ Db = "phpdemo ";$ Name = "sa ";$ Pass =
Introduction: Linux Under the configuration of PHP extension MSSQL, so that PHP through the MSSQL tool implementation and remote win SQL Server data transfer.There are two ways of doing this:One, the first time to compile PHP to provide MSSQL
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.